Shader "MultiTexture"
{
    Properties
    {
      _Color("Main Color", Color) = (1,1,1,1)
      _Alpha("Alpha", float) = 1
      _WhiteColor("WhiteColor", float) = 0
      _OriginColor("OriginColor", float) = 0
      _MultiColor("MultiColor", float) = 1
      _MainTex("Base (RGB) Trans (A)", 2D) = "white" {}
      _MainTex2("MainTex2 (RGBA)", 2D) = "white" {}
    }
        SubShader
    {
      Tags
      {
        "IGNOREPROJECTOR" = "true"
        "QUEUE" = "Transparent"
        "RenderType" = "Transparent"
      }
      LOD 110
      Pass // ind: 1, name: 
      {
        Tags
        {
          "IGNOREPROJECTOR" = "true"
          "QUEUE" = "Transparent"
          "RenderType" = "Transparent"
        }
        LOD 110
        ZWrite Off
        Cull Off
        Fog
        {
          Mode  Off
        }
        Blend SrcAlpha OneMinusSrcAlpha
        // m_ProgramMask = 6
        CGPROGRAM
        //#pragma target 4.0

        #pragma vertex vert
        #pragma fragment frag

        #include "UnityCG.cginc"


        #define CODE_BLOCK_VERTEX
        //uniform float4x4 unity_ObjectToWorld;
        //uniform float4x4 unity_MatrixVP;
        uniform float _Alpha;
        uniform float _WhiteColor;
        uniform float _OriginColor;
        uniform float _MultiColor;
        uniform sampler2D _MainTex;
        uniform sampler2D _MainTex2;
        struct appdata_t
        {
            float4 vertex :POSITION0;
            float4 color :COLOR0;
            float2 texcoord :TEXCOORD0;
            float2 texcoord1 :TEXCOORD1;
        };

        struct OUT_Data_Vert
        {
            float4 color :COLOR0;
            float4 texcoord :TEXCOORD0;
            float4 vertex :SV_POSITION;
        };

        struct v2f
        {
            float4 color :COLOR0;
            float4 texcoord :TEXCOORD0;
        };

        struct OUT_Data_Frag
        {
            float4 color :SV_Target0;
        };

        float4 u_xlat0;
        float4 u_xlat1;
        OUT_Data_Vert vert(appdata_t in_v)
        {
            OUT_Data_Vert out_v;
            out_v.vertex = UnityObjectToClipPos(in_v.vertex);
            out_v.color = in_v.color;
            out_v.texcoord.xy = float2(in_v.texcoord.xy);
            out_v.texcoord.zw = in_v.texcoord1.xy;
            return out_v;
        }

        #define CODE_BLOCK_FRAGMENT
        float3 u_xlat0_d;
        float3 u_xlat10_0;
        float4 u_xlat10_1;
        float3 u_xlat16_2;
        float3 u_xlat16_3;
        float u_xlat12;
        OUT_Data_Frag frag(v2f in_f)
        {
            OUT_Data_Frag out_f;
            u_xlat10_0.xyz = tex2D(_MainTex2, in_f.texcoord.zw).xyz.xyz;
            u_xlat10_1 = tex2D(_MainTex, in_f.texcoord.xy);
            u_xlat16_2.xyz = float3(max(u_xlat10_1.xyz, float3(0.5, 0.5, 0.5)));
            u_xlat16_2.xyz = float3(min(u_xlat16_2.xyz, float3(1, 1, 1)));
            u_xlat16_2.xyz = float3((u_xlat16_2.xyz + float3(-0.5, (-0.5), (-0.5))));
            u_xlat16_2.xyz = float3((u_xlat16_2.xyz + u_xlat16_2.xyz));
            u_xlat16_3.xyz = float3(max(u_xlat10_1.xyz, float3(0, 0, 0)));
            u_xlat16_3.xyz = float3(min(u_xlat16_3.xyz, float3(0.5, 0.5, 0.5)));
            u_xlat16_3.xyz = float3((u_xlat16_3.xyz + u_xlat16_3.xyz));
            u_xlat16_2.xyz = float3(((u_xlat16_3.xyz * u_xlat10_0.xyz) + u_xlat16_2.xyz));
            u_xlat0_d.xyz = float3((u_xlat16_2.xyz + float3(float3(_WhiteColor, _WhiteColor, _WhiteColor))));
            u_xlat0_d.xyz = float3((u_xlat0_d.xyz * float3(float3(_MultiColor, _MultiColor, _MultiColor))));
            u_xlat0_d.xyz = float3(((u_xlat10_1.xyz * float3(float3(_OriginColor, _OriginColor, _OriginColor))) + u_xlat0_d.xyz));
            u_xlat16_2.x = (u_xlat10_1.w * in_f.color.w);
            u_xlat12 = (u_xlat16_2.x * _Alpha);
            out_f.color.w = u_xlat12;
            out_f.color.xyz = float3((u_xlat0_d.xyz * in_f.color.xyz));
            return out_f;
        }


        ENDCG

      } // end phase
    }
        SubShader
        {
          Tags
          {
            "IGNOREPROJECTOR" = "true"
            "QUEUE" = "Transparent"
            "RenderType" = "Transparent"
          }
          LOD 100
          Pass // ind: 1, name: 
          {
            Tags
            {
              "IGNOREPROJECTOR" = "true"
              "QUEUE" = "Transparent"
              "RenderType" = "Transparent"
            }
            LOD 100
            ZWrite Off
            Cull Off
            Fog
            {
              Mode  Off
            }
            Blend SrcAlpha OneMinusSrcAlpha
            // m_ProgramMask = 6
            CGPROGRAM
            //#pragma target 4.0

            #pragma vertex vert
            #pragma fragment frag

            #include "UnityCG.cginc"


            #define CODE_BLOCK_VERTEX
            //uniform float4x4 unity_ObjectToWorld;
            //uniform float4x4 unity_MatrixVP;
            uniform float4 _MainTex_ST;
            uniform float4 _MainTex2_ST;
            uniform float4 _Color;
            uniform sampler2D _MainTex;
            uniform sampler2D _MainTex2;
            struct appdata_t
            {
                float3 vertex :POSITION0;
                float4 color :COLOR0;
                float3 texcoord :TEXCOORD0;
                float3 texcoord1 :TEXCOORD1;
            };

            struct OUT_Data_Vert
            {
                float4 color :COLOR0;
                float2 texcoord :TEXCOORD0;
                float2 texcoord1 :TEXCOORD1;
                float4 vertex :SV_POSITION;
            };

            struct v2f
            {
                float2 texcoord :TEXCOORD0;
                float2 texcoord1 :TEXCOORD1;
            };

            struct OUT_Data_Frag
            {
                float4 color :SV_Target0;
            };

            float4 u_xlat0;
            float4 u_xlat1;
            OUT_Data_Vert vert(appdata_t in_v)
            {
                OUT_Data_Vert out_v;
                out_v.color = in_v.color;
                out_v.color = clamp(out_v.color, 0, 1);
                out_v.texcoord.xy = float2(TRANSFORM_TEX(in_v.texcoord.xy, _MainTex));
                out_v.texcoord1.xy = float2(TRANSFORM_TEX(in_v.texcoord1.xy, _MainTex2));
                out_v.vertex = UnityObjectToClipPos(float4(in_v.vertex, 0));
                return out_v;
            }

            #define CODE_BLOCK_FRAGMENT
            float4 u_xlat16_0;
            float4 u_xlat10_0;
            float4 u_xlat10_1;
            OUT_Data_Frag frag(v2f in_f)
            {
                OUT_Data_Frag out_f;
                u_xlat10_0 = tex2D(_MainTex, in_f.texcoord.xy);
                u_xlat16_0 = (u_xlat10_0 * _Color);
                u_xlat10_1 = tex2D(_MainTex2, in_f.texcoord1.xy);
                out_f.color = (u_xlat16_0 * u_xlat10_1);
                return out_f;
            }


            ENDCG

          } // end phase
        }
            FallBack Off
}
